package com.linq.cool.beauty.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @Author: yqlin
 * @Date: 2021/2/4 13:35
 * @Description:
 * @Version: 1.0.0
 */
@Data
@Component
@ConfigurationProperties(prefix = "baidu.map")
public class BaiduMapProperties {
    private String ak;
    private String domain;

    /**
     * http://api.map.baidu.com/geocoding/v3/?address=北京市海淀区上地十街10号&output=json&ak=您的ak&callback=showLocation //GET请求
     *
     * @param address 地址
     *
     * @return 请求链接
     */
    public String getUrl(String address) {
        return domain + "?address=" + address + "&output=json&ak=" + ak + "&callback=showLocation";
    }
}
